#include "pushbutton.h"
#include "widget.h"
PushButton::PushButton(QWidget*parent)
    :QPushButton(parent)
    ,rect(new QRect(parent->rect()))
{
}

PushButton::~PushButton()
{
    delete rect;
}

void PushButton::enterEvent(QEvent *event)
{
    (void)event;
    int x = rand()%rect->width();
    int y = rand()%rect->height();
    this->setGeometry(x,y,this->width(),this->height());
}

